/* cmw.t  CUSTOMER MASTER WRITE TRIGGER                                   */
/*Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                     */
/*All rights reserved worldwide.  This is an unpublished work.            */
/*V8:ConvertMode=NoConvert*/
/**************************************************************************/
/*  Program :cmw.t                                                        */
/*  Author  :Denis Tatarik                                                */
/*  Date    :07/20/98                                                     */
/*  Description: cm_mstr WRITE trigger program                            */
/*          In order to enhance this trigger to support additional        */
/*          interfaces, add a DO-END block similary to the one            */
/*          used for the Logistics Interface to (1) check for the         */
/*          need to continue processing; (2) move the relevant            */
/*          fields to an appropriate work area; and (3) call              */
/*          one or more subprograms to continue processing.               */
/*          This .t proram should remain short, relying on                */
/*          subprograms to perform most of the work.                      */
/**************************************************************************/
/*                             MODIFY LOG                                 */
/**************************************************************************/
/*Revision 8.6     Last Modified:  07/29/98 BY: *M009* Denis Tatarik      */
/*Revision 9.1     Last Modified:  09/07/99 BY: *N02H* Robert Jensen      */
/*Revision 9.1     Last Modified:  10/07/99 BY: *N03L* Robert Jensen      */
/*Revision 9.1     Last Modified:  08/11/00 BY: *N0KK* jyn                */
/*                                                                        */
/**************************************************************************/

/*N03L*/ /* Add argument to lgarex.p call */
TRIGGER PROCEDURE FOR WRITE OF CM_MSTR OLD BUFFER OLD_CM_MSTR.

        {mfdeclre.i}

/*N03L*/define variable nPublished as integer no-undo.
/*M009 Commented out because of scope reductions in On/Q Logistics 1.1 */
/*N02H*//* Restored processing for Logistics in MFG/PRO 9.1 */
        /* Logistics Interface processing */
LG:     do:
/*N02H*/   /* If there is no logistics application ID, then do not process */
/*N02H*/   if can-find(first lgs_mstr no-lock
/*N02H*/   where lgs_mstr.lgs_app_id <> "")
/*N02H*/   then do:
/*N02H*/      /* Did the credit limit or balance change? */
/*N02H*/      if old_cm_mstr.cm_balance <> cm_mstr.cm_balance or
/*N02H*/      old_cm_mstr.cm_cr_limit <> cm_mstr.cm_cr_limit or
/*N02H*/      old_cm_mstr.cm_curr <> cm_mstr.cm_curr then do:
/*N02H*/         /* Yes, call logistics to process */
/*N02H*/         {gprunmo.i &module="LG"
/*N02H*/         &program="lgarex.p"
/*N03L*//*N02H*/ &param="""(input recid(cm_mstr), output nPublished)"""}
/*N02H*/      end.
/*N02H*/   end.
        end.
